package erfgame.frontend.desktop.view.terrain.iso.handler;

import erfgame.core.world.World;

public class FixedZLevelSelector implements ZLevelSelector {
	
	private World world;
	private int[] range;
	
	public FixedZLevelSelector( World world ) {
		this.world = world;
	}

	public void addZ(int z) {
		int blockDepth = world.getBlockDepth();
		int zLayer = z / blockDepth;
		if( zLayer >= 0 && zLayer < world.getBlocksZ() ) {
			if( range == null ) {
				range = new int[]{
					zLayer, zLayer	
				};
			}
		}
	}

	public int[] getRange() {
		return this.range;
	}

	public void reset() {
		this.range = null;
	}

}
